
//------------------------------------------------------------------------------

using Apps.Models;
using Apps.IDAL.CY;
using System;
using System.Linq;
using System.Linq.Expressions;

namespace Apps.DAL.CY
{
	public partial class CY_MIX_AGCRepository:BaseRepository<CY_MIX_AGC>,ICY_MIX_AGCRepository,IDisposable
	{
	    public CY_MIX_AGCRepository(DBContainer db):base(db)
        {
        
        }

        public IQueryable<CY_MIX_AGCModel> QueryMixAgcList(Expression<Func<CY_MIX_AGCModel, bool>> whereLambda)
        {
            IQueryable<CY_MIX_AGCModel> list = from a in Context.CY_MIX_AGC
                                               join b in Context.PUB_CREW on a.CREW_ID equals b.CREW_ID into stock
                                               from tb in stock.DefaultIfEmpty()
                                               select new CY_MIX_AGCModel()
                                               {
                                                   CREW_ID = a.CREW_ID,
                                                   CREW_NAME = tb.CREW_NAME,
                                                   HODAY = a.HODAY,
                                                   HOTIME = a.HOTIME,
                                                   LOAD = a.LOAD
                                               };
            return list;
        }
    }
}
